<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.util.*,java.io.*" errorPage="/errorpage.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head><title>ErrorProne</title></head>
  <body>
    <h1>The Value Store</h1>
    <% String command = request.getParameter("command"); %>
    <% String variable = request.getParameter("variable"); %>
    <% if (command.equals("reset")) {
         application.setAttribute(variable, "0");
       } else if (command.equals("inc")) {
         int value = Integer.parseInt((String)application.getAttribute(variable)) + 1;
         application.setAttribute(variable, String.valueOf(value));
       }
    %>
    The value of <%= variable %> is now <%= application.getAttribute(variable) %>
  </body>
</html>
